import {API_ROOT} from './../config'
import {fetch,postData,postJson} from './../service/httpService'

//列表
export const getDateList= (data) => {
	let body = { 
		model: data.model,
        offset:data.offset || 0,
        limit:data.limit || 1000,
        with:data.with,
        condition:data.condition,
        search: data.search || {},
        condition:data.condition,
    }
	return postJson(API_ROOT+'common/get-list-by-condition',body)
}
//详情
export const getDataDetail= (data) => {
	return postJson(API_ROOT+'common/get-info-by-id',data)
}
//更新
export const createData= (data) => {
	return postJson(API_ROOT+'common/update-or-create-data',data)
}

//批量更新
export const createBatchData= (data) => {
	return postJson(API_ROOT+'common/update-attributes',data)
}

//登录接口
export const postLogin= (body) => {
	return postJson(API_ROOT+'login/admin-login',body)
}

//上传图片
export const uploadFile= (body) => {
	return postJson(API_ROOT+'base/upload-file',body)
}

//上传图片
export const getKuaidi= (body) => {
	return postJson(API_ROOT+'common/get-kuaidi',body)
}